class Solution:
    def minimumPossibleSum(self, n: int, target: int) -> int:
        m = target // 2
        return ((1 + m) * m // 2 + (target + target + n - m ) * (n - m) // 2) % 1000000007